<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
 
require_once ('BaseService.php');

class ReportesService extends BaseService {

    public function getServiceClass() {
        return "Reportes";
    }

    public function Create(Reportes $Reporte) {
        $serializer = parent::getSerializer(parent::getMimeType(), "Reportes");
        $data = $serializer->serialize($Reporte);

        $response = parent::invokeService("Create", $data);
        return $response;
    }

    function GetAll() {
        $response = parent::invokeService("GetAll");
        $result = $response;

        /* if ($this->shouldDecode) {
          Loader::using("models::entities::Reportes");
          $decoder = parent::getSerializer(parent::getMimeType(), "Reportes", Reportes::MAPPING());
          $result = $decoder->deserializeArray($response);
          } */
        return $result;
    }

    public function Update(Reportes $Reporte) {
        $serializer = parent::getSerializer(parent::getMimeType(), "Reportes");
        $data = $serializer->serialize($Reporte);
        $response = parent::invokeService("Update", $data);
        return $response;
    }

    function GetByPracticante(Reportes $Reporte) {
        $response = parent::invokeService("GetByPracticante", $Reporte);
        $result = $response;

        if ($this->shouldDecode) {
            Loader::using("models::entities::Reportes");
            $decoder = parent::getSerializer(parent::getMimeType(), "Reportes");
            $result = $decoder->deserializeArray($response);
        }

        return $result;
    }
    
    function GetById($id) {
        $response = parent::invokeService("GetById", $id);
        $result = $response;
        
        if ($this->shouldDecode) {
            Loader::using("models::entities::Reportes");
            $decoder = parent::getSerializer(parent::getMimeType(), "Reportes");
            $result = $decoder->deserialize($response);
        }        
        
        return $result;
    }

    function GetByEstado($EstadoReporte) {
        $response = parent::invokeService("GetByEstado", $EstadoReporte);
        $result = $response;

        Loader::using("models::entities::Reportes");
        $result = parent::processArrayResponse($response, parent::getMimeType(), "Reportes");

        return $result;
    }

}

?>
